<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.action,a.action:link,a.action:visited,a.action:hover{ font-weight:normal;}
a.dir:link,a.dir:visited{ text-decoration:none; font-weight:bold; color:#000;}
a.dir:hover{ text-decoration:underline; font-weight:bold; color:#F00;}
</style>
</head>
<body>
<div class="wrapper">
  <div class="title shadow titleBg">
    <table width="100%" border="0" cellspacing="1">
      <tr>
        <td><h1> {:$i->title} </h1></td>
      </tr>
    </table>
  </div>  
  <div class="content shadow">
    <table width="100%" border="0" cellspacing="1">
      <tr class="titleBg">
        <th scope="col"><input name="selAction" id="selAction" title="全选/取消" type="checkbox" value="" onclick="if(this.checked){selAll('selected[]');}else{selNone('selected[]');}" class="noBorder" /></th>
        <th scope="col" class="textL action">{:if $i->param.dir != ''}【<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/{:$i->p[1]}?edit={:$i->param.edit}&ext={:$i->param.ext}&dir={:$i->param.dir|@dirname}">↑上级目录</a>】{:else}【上级目录】{:/if}【/{:$i->param.dir}】</th>
        <th scope="col">操作</th>
      </tr>
      {:foreach item=item from=$i->lists}
      <tr>
      {:if $item.type == 'dir'}
        <td><input name="selected[]" title="Name:{:$item.name}" type="checkbox" value="{:$item.name}" class="noBorder" /></td>
        <td class="textL">【目录】<a class="dir" href="?edit={:$i->param.edit}&ext={:$i->param.ext}&dir={:$i->param.dir}/{:$item.name}">{:$item.name}</a></td>
        <td>
        <a onclick="del('','{:$item.name}'); return false;" href="#@">删除</a>
        </td>
       {:elseif $item.type == 'image'}
       <td><input name="selected[]" title="Name:{:$item.name}" type="checkbox" value="{:$item.name}" class="noBorder" /></td>
        <td class="textL">〖文件〗{:$item.name}</td>
        <td>
        <a onclick="del('','{:$item.name}'); return false;" href="#@">删除</a>
        </td>
        {:elseif $item.type == 'txt'}
       <td><input name="selected[]" title="Name:{:$item.name}" type="checkbox" value="{:$item.name}" class="noBorder" /></td>
        <td class="textL">〖文件〗{:$item.name}</td>
        <td>
        <a href="{:$smarty.const.BOOT_URL}/{:$i->c}/edit/show/template?filename={:$item.name}&dir={:$i->param.dir}&ext={:$i->param.ext}&edit={:$i->param.edit}">修改</a> | <a onclick="del('','{:$item.name}'); return false;" href="#@">删除</a>
        </td>
        {:else}
        <td><input name="selected[]" title="Name:{:$item.name}" type="checkbox" value="{:$item.name}" class="noBorder" /></td>
        <td class="textL">〖文件〗{:$item.name}</td>
        <td>
        <a onclick="del('','{:$item.name}'); return false;" href="#@">删除</a>
        </td>
        {:/if}
      </tr>
      {:/foreach}       
      <tr>
        <td colspan="3" class="lightGreyBg textL"> <a href="#@" onclick="selAll('selected[]');$('#selAction').attr('checked', true);return false;">全选</a> | <a href="#@" onclick="return selAnti('selected[]');">反选</a> | <a href="#@" onclick="return del('selected[]');">删除</a> | {:$i->pagesCode}</td>
      </tr>
    </table>
  </div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function del(name,id)
{
	var ids='';
	
	if(id == undefined)
	{
		$("input:checked[name='"+name+"']").each(function(i){
			ids+=this.value+',';
		});
		
		ids = ids.substr(0,ids.length-1);
	}
	else
	{
		ids = id;	
	}
	
	if(ids.length==0)
	{
		alert('您还没有选中要删除的文件或目录');
		return false;
	}
	
	if(confirm('确定删除?'))
	{
		getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del?files='+ids+'&dir={:$i->param.dir}', '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/{:$i->p[1]}?dir={:$i->param.dir}&ext={:$i->param.ext}&edit={:$i->param.edit}');
	}
	
	return false;
}

$(document).ready(function(){
	$(".helpTip").tooltip({cssClass:"tooltip", xOffset:30, opacity:5});
});
</script>
</body>
</html>
